//
//  VSRootModel.m
//  UI项目2.0
//
//  Created by dlios on 15/7/15.
//  Copyright (c) 2015年 星际科技. All rights reserved.
//

#import "VSRootModel.h"

@implementation VSRootModel
#pragma mark - dealloc
- (void)dealloc
{
    [super dealloc];
    
}
#pragma mark - 初始化
- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        // KVC 赋值
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
#pragma mark - 便利构造器
+(instancetype)baseModelWithDic:(NSDictionary *)dic
{
    id objc = [[[[self class]alloc]initWithDic:dic] autorelease];
    return objc;
}
#pragma mark = 转化方法
+ (NSMutableArray *)arrarWithModelByArray:(NSArray *)array
{
    // 创建一个可变数据 保存Model 并返回结果
    NSMutableArray *arr = [NSMutableArray array];
    // 遍历参数数组
    for (NSDictionary *dic  in array) {
        // 自动释放池
        @autoreleasepool {
            id model = [[self class]baseModelWithDic:dic];
            [arr addObject:model];
        }
    }
    return arr;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}


@end
